/**
 * 
 * JS编码题
1、 输入一个随机位数的数字(10位以内)，逆序打印输出各位数是多少
如：输入：8273842
输出：
2
4
8
3
7
2
8
 */

var randomNumber = Math.round(Math.random() * 1000000000);
var randomString = String(randomNumber);  
console.log(randomString.length);
console.log(randomString % 10);

var len = randomNumber.length;
for (let i = 0; i < len; i++) {
  // const a = randomString[len.length - i];
  b = randomString % 10;
  randomString = parseInt(randomString / 10);
  console.log(b);
}